home *** CD-ROM | disk | FTP | other *** search
/ Aminet 35 / Aminet 35 (2000)(Schatztruhe)[!][Feb 2000].iso / Aminet / gfx / misc / gnuplot-src.lha / gnuplot-3.7.1src / gnuplot-3.7.1.lha / gnuplot-3.7.1 / os2 / gnupmdrv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-15  |  6.2 KB  |  159 lines

  1. /* gnushell dow funcIºÿÿ*
  2. ** static char RCSid[]="$Id: gnupmdrv.h,v 1.1.1.2 1998/04/15 19:23:39 lhecking Exp $" ;
  3. */
  4.  
  5. /* PM driver for GNUPLOT */
  6.  
  7. /*[
  8.  * Copyright 1992, 1993, 1998 Roger Fearick
  9.  *
  10.  * Permission to use, copy, and distribute this software and its
  11.  * documentation for any purpose with or without fee is hereby granted,
  12.  * provided that the above copyright notice appear in all copies and
  13.  * that both that copyright notice and this permission notice appear
  14.  * in supporting documentation.
  15.  *
  16.  * Permission to modify the software is granted, but not the right to
  17.  * distribute the complete modified source code.  Modifications are to
  18.  * be distributed as patches to the released version.  Permission to
  19.  * distribute binaries produced by compiling modified sources is granted,
  20.  * provided you
  21.  *   1. distribute the corresponding source modifications from the
  22.  *    released version in the form of a patch file along with the binaries,
  23.  *   2. add special version identification to distinguish your version
  24.  *    in addition to the base release version number,
  25.  *   3. provide your name and address as the primary contact for the
  26.  *    support of your modified version, and
  27.  *   4. retain our contact information in regard to use of the base
  28.  *    software.
  29.  * Permission to distribute the released version of the source code along
  30.  * with corresponding source modifications in the form of a patch file is
  31.  * granted with same provisions 2 through 4 for binary distributions.
  32.  *
  33.  * This software is provided "as is" without express or implied warranty
  34.  * to the extent permitted by applicable law.
  35. ]*/
  36.  
  37.  
  38. /*
  39.  * AUTHOR
  40.  * 
  41.  *   Gnuplot driver for OS/2:  Roger Fearick
  42.  * 
  43.  * Send your comments or suggestions to 
  44.  *  info-gnuplot@dartmouth.edu.
  45.  * This is a mailing list; to join it send a note to 
  46.  *  majordomo@dartmouth.edu.  
  47.  * Send bug reports to
  48.  *  bug-gnuplot@dartmouth.edu.
  49. **/
  50.  
  51.     /* include resource defines */
  52.     
  53. #ifndef DISPDEFS_H
  54. /*#include "dispdefs.h"*/
  55. #include "dialogs.h"
  56. #endif
  57.  
  58. /*==== own window messages  =================================================*/
  59.  
  60. #define WM_GNUPLOT          (WM_USER+20)
  61. #define WM_PAUSEPLOT        (WM_USER+21)
  62. #define WM_PAUSEEND         (WM_USER+22)
  63. #define WM_GPSTART          (WM_USER+23)
  64. #define WM_USER_SET_DATA    (WM_USER+90)
  65. #define WM_USER_GET_DATA    (WM_USER+91)
  66. #define WM_USER_CHGFONT     (WM_USER+10) 
  67. #define WM_USER_PRINT_BEGIN (WM_USER+200)
  68. #define WM_USER_PRINT_OK    (WM_USER+201)
  69. #define WM_USER_PRINT_ERROR (WM_USER+202)
  70. #define WM_USER_DEV_ERROR   (WM_USER+203)
  71. #define WM_USER_PRINT_QBUSY (WM_USER+204)
  72. #define WM_USER_PRINT_CANCEL (WM_USER+205)
  73.  
  74. /*==== various names ========================================================*/
  75.  
  76. #define GNUPIPE     "\\pipe\\gnuplot"       /* named pipe to gnuplot */
  77. #define GNUQUEUE    "\\queues\\gnuplot"     /* queue for gnuplot termination */
  78. #define GNUSEM      "\\sem32\\gnuplot.sem"  /* synch gnuplot and gnupmdrv */
  79. #define GNUINI      "GNUPMDRV.INI"          /* ini filename */
  80. #define ENVGNUHELP  "GNUHELP"               /* gnuplot help envionment name */
  81. #define ENVGNUPLOT  "GNUPLOT"               /* general gnuplot environment */
  82. #define GNUEXEFILE  "gnuplot.exe"           /* exe file name */
  83. #define GNUHELPFILE "gnuplot.gih"           /* help file name */
  84. #define GNUTERMINIT "GNUTERM=pm"            /* terminal setup string */
  85. #define INITIAL_FONT "14.Helvetica"         /* initial font for plots */
  86. #define APP_NAME     "GnuplotPM"            /* application name */
  87. #define CHILD_NAME   "GnupltChild"          /* child window name */
  88.  
  89.         // profile (ini file) names 
  90. #define INISHELLPOS  "PosShell"
  91. #define INIPAUSEPOS  "PosPause"
  92. #define INIPLOTPOS   "PosPlot"
  93. #define INIFONT      "DefFont" 
  94. #define INIFRAC      "PageFrac"
  95. #define INIPRDRIV    "DrivData"  
  96. #define INIPRPR      "Printer"  
  97. #define INIOPTS      "DefOpts"      
  98. #define INICHAR      "Fontdata"      
  99.  
  100. /*==== global data  ==========================================================*/
  101.  
  102. HAB         hab ;                   // application anchor block handle 
  103. HWND           hApp ;                  // application window handle 
  104. HWND        hwndFrame ;             // frame window handle 
  105. #define   FONTBUF   256         /* buffer for dropped font namesize */
  106. #define     GNUXPAGE  19500       /* width of plot area in 0.01 cm */
  107. #define     GNUYPAGE  12500       /* height of plot area in 0.01 cm */
  108.  
  109. /*==== stuff for querying printer capability =================================*/
  110.  
  111. typedef struct {  //query data for printer setup
  112.     int   cbStruct ;       /* size of struct */
  113.     float xsize ;
  114.     float ysize ;
  115.     float xfrac ;
  116.     float yfrac ;
  117.     short caps ;
  118.     char  szFilename[CCHMAXPATHCOMP] ;
  119.     char  szPrinterName[128] ;
  120.     PPRQINFO3 piPrinter ;
  121.     int   cbpdriv ;
  122.     PDRIVDATA pdriv ;
  123.     } QPRINT, *PQPRINT ;
  124.  
  125. #define QP_CAPS_NORMAL 0
  126. #define QP_CAPS_FILE   1   /* can print to file */
  127.  
  128. /*==== stuff for pause dialogs =================================*/
  129.  
  130. typedef struct {  //pause data for dialog box
  131.     int   cbStruct ;       /* size of struct */
  132.     char  *pszMessage ;    /* pause message */
  133.     PSWP  pswp ;           /* dialog box position */
  134.     } PAUSEDATA, *PPAUSEDATA ;
  135.  
  136. /*==== function declarations =================================================*/
  137.  
  138. short            ScalePS( HPS ) ;
  139. int              SetupPrinter( HWND, PQPRINT ) ;
  140. HDC              OpenPrinterDC( HAB, PQPRINT, LONG, char* ) ;
  141. int              SetPrinterMode( HWND, PQPRINT ) ;
  142. MPARAM           PrintCmdProc( HWND, ULONG, MPARAM, MPARAM ) ;
  143. MRESULT EXPENTRY PrintDlgProc( HWND, ULONG, MPARAM, MPARAM ) ;
  144. MRESULT EXPENTRY PauseMsgDlgProc( HWND, ULONG, MPARAM, MPARAM ) ;
  145. MRESULT EXPENTRY QFontDlgProc( HWND ,ULONG, MPARAM, MPARAM ) ;
  146. MRESULT EXPENTRY QPrintDlgProc (HWND, ULONG, MPARAM, MPARAM) ;
  147. MRESULT EXPENTRY QPrintersDlgProc ( HWND, ULONG, MPARAM, MPARAM ) ;
  148. MRESULT EXPENTRY DisplayClientWndProc(HWND, ULONG, MPARAM, MPARAM);
  149. MRESULT EXPENTRY NewFrameWndProc(HWND, ULONG, MPARAM, MPARAM) ;
  150. MRESULT EXPENTRY About(HWND, ULONG, MPARAM, MPARAM);
  151. MRESULT EXPENTRY CancelPrintDlgProc ( HWND, ULONG, MPARAM, MPARAM ) ;
  152.  
  153.         /* own window functions... */
  154. void WinSetDlgItemFloat( HWND, USHORT, float ) ;
  155. void WinSetDlgItemFloatF( HWND, USHORT, int, float ) ;
  156. void WinQueryDlgItemFloat( HWND, USHORT, float* ) ;
  157.  
  158.  
  159.